package com.shipxpress.register.view;

import java.util.ArrayList;
import java.util.List;

import org.apache.struts.action.ActionForm;
import com.shipxpress.register.model.User;
import com.shipxpress.register.model.UserList;

public class UserListForm extends ActionForm {

    public List<UserForm> list;

    public List<UserForm> getList() {
        return list;
    }

    public UserListForm() {
        this.list = new ArrayList<UserForm>();
    }

    public void setUserList(UserList userList) {
        //clear the old data
        getList().clear();

        //now add the forms from the list
        for (User user : userList) {
            UserForm userForm = new UserForm(user);
            getList().add(userForm);
        }
    }
}
